package com.ljd.server.util;

import com.ljd.server.pojo.Admin;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * 操作员工具类
 *
 * @author ljd on 2022/1/25
 * @PACKAGE_NAME: com.ljd.server.util
 * @PROJECT_NAME: yeb
 */
public class AdminUtils {

    /**
     * 获取当前登录的操作员
     * @return
     */
    public static Admin getCurrentAdmin() {
        return ((Admin)SecurityContextHolder.getContext().getAuthentication().getPrincipal());
    }
}
